package com.liuhaozzu.zookeeper.zookeeper_app.acl;

import java.io.IOException;

import javax.xml.validation.Schema;

import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.ZooKeeper;
import org.apache.zookeeper.ZooDefs.Ids;

public class ACL {

	final static String path="/liuhaozzu";
	public static void main(String[] args) throws Exception {
		ZooKeeper zooKeeper1=new ZooKeeper("hadoop1:2181", 5000, null);
		zooKeeper1.addAuthInfo("digest", "foo:true".getBytes());
	
		zooKeeper1.create(path, "init".getBytes(), Ids.CREATOR_ALL_ACL, CreateMode.EPHEMERAL);
		ZooKeeper zooKeeper2=new ZooKeeper("hadoop1:2181",50000,null);
		zooKeeper2.getData(path, false, null);
	}
}
